﻿using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WebApi.Bill.Biz;
using WebApi.Models;

namespace WebApi.Controllers
{
    public class AccidentController : BaseController
    {

        #region 获取新闻列表 List
        /// <summary>
        /// 获取新闻分类
        /// </summary>
        [HttpGet]
        public ActionResult<AccidentModel> List()
        {
            ResponseDataNews res = new ResponseDataNews();

            try
            {
                List<NewsGetData> data = BizBase.Get<BizAccident>().List();
                res.code = 200;
                res.msg = "查询成功";
                res.rows = data;
                res.total = Convert.ToString(data.Count());


                return new JsonResult(res);
            }
            catch (Exception ex)
            {
                return this.ControllerExHandler(res, "List", ex);
            }
        }


        #endregion

    }
}
